package com.example.emplyee;

import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

@Getter
@Setter
public class Employee {
    @NotNull(message = "id不能为空")
    private String id;
    @NotNull(message = "姓名不能为空")
    private String name;
    @Min(0)
    @Max(8000)
    private float deal;
    @Min(0)
    @Max(1000)
    private float tax;
    private float fact;

    public Employee(String id, String name, float deal, float tax) {
        this.id = id;
        this.name = name;
        this.deal = deal;
        this.tax = tax;
        this.fact=this.deal-this.tax;
    }
}
